package com.imooc.ecommerce.feign;

import com.imooc.ecommerce.account.AddressInfo;
import com.imooc.ecommerce.common.TableId;
import com.imooc.ecommerce.feign.hystrix.AddressClientHystrix;
import com.imooc.ecommerce.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * <p>用户账户服务 Feign 接口(安全的)
 *
 * @author Yaxi.Zhang
 * @since 2022/11/16 19:46
 */
@FeignClient(contextId = "AddressClient", value = "e-commerce-account-service", fallback = AddressClientHystrix.class)
public interface AddressClient {
    /**
     * <p>根据 id 查询地址信息
     */
    @RequestMapping(value = "/ecommerce-account-service/address/address-info-by-table-id", method = RequestMethod.POST)
    CommonResponse<AddressInfo> getAddressInfoByTablesId(@RequestBody TableId tableId);
}
